﻿using System.ServiceModel;
using Ayatta.Contract.Domain;
using Ayatta.Contract.Component;
using System.Collections.Generic;

namespace Ayatta.Contract
{
    [ServiceContract(Namespace = ServiceContract.Namespace)]
    public interface IProductIndexService
    {
        /// <summary>
        /// 生成商品索引
        /// 异步 自动在主从目录中切换
        /// </summary>
        [OperationContract]
        void Index();

        /// <summary>
        /// 分词
        /// </summary>
        /// <param name="input">输入文字</param>
        /// <param name="distinct">是否去重</param>
        /// <returns></returns>
        [OperationContract]
        string[] Participle(string input, bool distinct = false);

        /// <summary>
        /// 商品搜索
        /// </summary>
        /// <param name="param">搜索参数</param>
        /// <returns></returns>
        [OperationContract]
        PagedList<ProductItem, ProductQueryStatistics> Search(ProductQueryParam param);

    }
}